package lesson14;

public class CarDemo 
{
	public static void main(String[] args) {
		
		Car car1 = new Car();
		Car car2 = new Car();
		
		Person krasi = new Person();
		krasi.name = "Krasi";
		krasi.age = 27;
		
		car1.owner = krasi;
		car1.owner.age = 28;
		
		car2.owner=  new Person();
		
		car2.owner.name = "Pesho";
		car2.owner.age = 21;
		
		
		
		car1.model = "Golf";
		car1.color = "Black";
		car1.currentGear = 2;
		car1.currentSpeed = 90;
		car1.maxSpeed = 230;

		car2.model = "Fiesta";
		car2.color = "Black";
		car2.currentGear = 2;
		car2.currentSpeed = 25;
		car2.maxSpeed = 150;
		
		System.out.println("Car 1:");
		System.out.println("model - " + car1.model);
		System.out.println("color - " + car1.color);
		System.out.println("currentGear - " + car1.currentGear);
		System.out.println("currentSpeed - " + car1.currentSpeed);
		System.out.println("maxSpeed - " + car1.maxSpeed);

		System.out.println("Car 2:");
		System.out.println("model - " + car2.model);
		System.out.println("color - " + car2.color);
		System.out.println("currentGear - " + car2.currentGear);
		System.out.println("currentSpeed - " + car2.currentSpeed);
		System.out.println("maxSpeed - " + car2.maxSpeed);
		
		car2.accelerate();
		car2.changeGearUp();
		car2.accelerate();
		car2.changeGearUp();
		
		car1.changeGear(4);
		car1.maxGear = 6;
		car1.changeGear(6);
	}
}
